# -*- coding = utf-8 -*-
# @Time : 2021/4/30 22:12
# @Author : 龙王赘婿_彪少
# @File : demo01.py
# @Software: PyCharm

# f = open("test.txt","r") #打开文件，w模式，写模式，文件不存在就新建
#
# # f.write("hello worldgf")
# content = f.read(5)
# print(content)
#
# content2 = f.read(5)
# print(content2)
#
# f.close() #关闭文件

# f = open("test.txt","r")
#
# content = f.readlines()
# #全部读出来，变成一个列表
# print(content)
#
# f.close() #关闭文件

# f = open("test.txt","r")
#
# content = f.readlines()
# #全部读出来，变成一个列表
# i = 1
# for temp in content:
#     print(i,temp)
#     i += 1
#
# f.close() #关闭文件

f = open("test.txt","r")

content = f.readline()
print(content)
content = f.readline()
print(content)


f.close() #关闭文件